{extend name="../../admin/view/main"}

{block name="content"}
<div class="think-box-shadow table-block">
    {include file='user/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='nowrap'>用户信息</th>
            <th class='nowrap'>推荐人信息</th>
            <th class='nowrap'>余额信息</th>
            <th class='nowrap'>注册时间</th>
            <th class='nowrap'></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class="sub-span-blue nowrap">
                <div class="headimg" data-tips-image data-lazy-src="{$vo.headimg|default='__ROOT__/static/theme/img/headimg.png'}"></div>
                <div class="inline-block">
                    {notempty name='vo.username'}
                    <div>姓名：<span>{$vo.username|default='-'}</span></div>
                    {else}
                    <div>昵称：<span>{$vo.nickname|default='-'}</span></div>
                    {/notempty}
                    <div>手机：<span>{$vo.phone|default='-'}</span></div>
                </div>
            </td>
            <td class="sub-span-blue nowrap">
                {notempty name='vo.fromer'}
                <div class="headimg" data-tips-image data-lazy-src="{$vo.fromer.headimg|default='__ROOT__/static/theme/img/headimg.png'}"></div>
                <div class="inline-block">
                    {notempty name='vo.fromer.username'}
                    <div>姓名：<span>{$vo.fromer.username|default='-'}</span></div>
                    {else}
                    <div>昵称：<span>{$vo.fromer.nickname|default='-'}</span></div>
                    {/notempty}
                    <div>手机：<span>{$vo.fromer.phone|default='-'}</span></div>
                </div>
                {else}
                <div class="color-desc">没有推荐人</div>
                {/notempty}
            </td>
            <td class="nowrap sub-span-blue">
                <div>余额统计：累计充值 <span>{$vo.balance_total+0}</span> 元，已使用 <span>{$vo.balance_used+0}</span> 元</div>
                <div>奖励统计：共奖励金额 <span>{$vo.amount_total+0}</span> 元，已提现 <span>{$vo.amount_used+0}</span> 元</div>
            </td>
            <td class="nowrap">
                使用状态：{if $vo.status eq 0}<b class="color-red margin-right-5">已冻结</b>{elseif $vo.status eq 1}<b class="color-green margin-right-5">已激活</b>{/if}<br>
                注册时间：{$vo.create_at|format_datetime}
            </td>
            <td class="nowrap">

                <!--{if auth("user_balance/add")}-->
                <a class="layui-btn layui-btn-sm layui-btn-primary" data-modal="{:url('user_balance/add')}?uid={$vo.id}">余额充值</a>
                <!--{/if}-->

                <!--{if auth("state") and $vo.status eq 1}-->
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('state')}" data-value="id#{$vo.id};status#0">冻结账号</a>
                <!--{/if}-->

                <!--{if auth("state") and $vo.status eq 0}-->
                <a class="layui-btn layui-btn-sm layui-btn-normal" data-action="{:url('state')}" data-value="id#{$vo.id};status#1">解冻账号</a>
                <!--{/if}-->
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}
